/*******************************************************************************
*  file    : qfftwindow.cpp
*  created : 12.04.2012
*  author  : Slyshyk Oleksiy (alex312@meta.ua)
*******************************************************************************/

#include "qfftwindow.hpp"
#include "ui_qfftwindow.h"
#include <cmath>

QFFTWindow::QFFTWindow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::QFFTWindow)
{
    ui->setupUi(this);

    connect(ui->spinBox_2, SIGNAL(valueChanged(int)), this, SLOT(intervalChanged(int)) );
    connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(onButonClick()) );
}

QFFTWindow::~QFFTWindow()
{
    delete ui;
}

void QFFTWindow::intervalChanged(int i)
{
    ui->wndWidthLabel->setText(QString("= %1").arg(1<<i));
}

void QFFTWindow::onButonClick()
{
    emit fft_window(ui->spinBox->value(), (1<<ui->spinBox_2->value()));
}

